const userRouter = require("../router/userRouter");
const loginRouter = require("../router/loginRouter.js")
const Koa = require("koa");
const bodyParser = require('koa-bodyparser');
const registerRouters = require("../router/index.js");

// 创建app
const app = new Koa();

// 使用中间件
app.use(bodyParser())

registerRouters(app) // 执行自动化注册路由
// app.use(userRouter.routes());
// app.use(userRouter.allowedMethods());
// app.use(loginRouter.routes());
// app.use(loginRouter.allowedMethods());

module.exports = app